package com.matt.foundation.vo;

import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Objects;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/11
 * *******************************
 */
@Data
public class ClassesChildrenListVo {

    private String id;

    private String name;

    private String gender;

    private String imgUrl;

    private String status;

    private String checkStatus;
    
    private String earlyLeftCourseNum; 


    public static ClassesChildrenListVo of(Object[] objects) {
        ClassesChildrenListVo vo = new ClassesChildrenListVo();
        vo.setId(objects[0] == null ? "" : objects[0].toString());
        vo.setName(objects[1] == null ? "" : objects[1].toString());
        vo.setGender(objects[2] == null ? "" : objects[2].toString());
        if (Objects.nonNull(objects[3]) && StringUtils.isNotBlank(objects[3].toString()))
            vo.setImgUrl(objects[3].toString());
        vo.setStatus(objects[4] == null ? "" : objects[4].toString());

        if(objects.length <= 5 || objects[5] == null) {
            vo.setEarlyLeftCourseNum("");
        }else{
            vo.setEarlyLeftCourseNum(objects[5].toString());
        }
        return vo;
    }

}
